import { defineStore } from 'pinia'
import { collectionReview } from '../utils/trueType'
import { collectionReviewTable } from '../utils/trueType'
export const useCollectionReviewStore = defineStore('collectionReview', {
    state: () => ({
        collectionStats: {
            totalReview: 0,
            todayNewReview: 0
        } as collectionReview,
        collectionReviewTable: [] as collectionReviewTable[],
        pageNum:1,
        pageSize:5,
        selectedIds :<number[]>([]),
        Loading:false
    }),
    actions: {
        addSelectedIds(id:number){
            if(this.selectedIds.includes(id)){
                this.selectedIds.splice(this.selectedIds.indexOf(id),1)
            }else{
                this.selectedIds.push(id)
            }
        },
        changeLoading(){
            this.Loading = !this.Loading
            setTimeout(() => {
                this.Loading = !this.Loading
            }, 500);
        }
    },
    getters: {

    },
}
)